0\r§mûüÆqò20(function () { 'use strict'; var _PUSH_EVENTS_UTM; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Give the service worker access to Firebase Messaging. * Note that you can only use Firebase Messaging here, other Firebase libraries * are not available in the service worker. * **/ /* eslint-disable no-undef */ importScripts('https://www.gstatic.com/firebasejs/3.9.0/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/3.9.0/firebase-messaging.js'); /** * Api url * * @type {string} */ var apiUrl = '/api/front/config'; /* eslint-enable no-undef */ /** * Push api events * * @type {enum} */ var PUSH_API_ICONS = { STRIPCHAT: '/worker/push_notification.png', XHAMSTERLIVE: '/worker/push_notification_xh.png' }; /** * Push events * * @type {enum} */ var PUSH_EVENTS = { PRIVATE_MESSAGE: 'privateMessage', MODEL_ONLINE: 'modelOnline' }; /** * Push events utm * * @type {enum} */ var PUSH_EVENTS_UTM = (_PUSH_EVENTS_UTM = {}, _defineProperty(_PUSH_EVENTS_UTM, PUSH_EVENTS.PRIVATE_MESSAGE, 'newMessagePush'), _defineProperty(_PUSH_EVENTS_UTM, PUSH_EVENTS.MODEL_ONLINE, 'modelOnlinePush'), _PUSH_EVENTS_UTM); /** * Is fetching config * * @type {?Boolean} */ var isFetching = void 0; /** * Config fetch promise * * @type {?Promise} */ var configPromise = void 0; /** * Static root * * @type {?string} */ var staticRoot = void 0; /** * Sender ID * * @type {string} */ var senderId = void 0; /** * Get action Url * * @param {string} event event name * @param {Object} data data * @return {string} */ var getActionUrl = function getActionUrl(event) { var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var _JSON$parse = JSON.parse(data), _JSON$parse$sender = _JSON$parse.sender, sender = _JSON$parse$sender === undefined ? '' : _JSON$parse$sender, _JSON$parse$modelUser = _JSON$parse.modelUsername, modelUsername = _JSON$parse$modelUser === undefined ? '' : _JSON$parse$modelUser; switch (event) { case PUSH_EVENTS.PRIVATE_MESSAGE: { return '/messages/' + sender; } case PUSH_EVENTS.MODEL_ONLINE: { return '/' + modelUsername; } default: { return ''; } } }; /** * Open client page * * @param {UIEvent} event */ var openClientPage = function openClientPage(event) { var _event$notification$d = event.notification.data, eventName = _event$notification$d.event, data = _event$notification$d.data; var eventUrl = getActionUrl(eventName, data); var utm = 'utm_campaign=push&utm_source=push&utm_medium=' + PUSH_EVENTS_UTM[eventName]; console.log('worker-push-notification openClientPage()', eventUrl); self.clients.openWindow(eventUrl + '?' + utm + '&pushNotification=' + eventName); event.notification.close(); }; // Firebase client var client = null; /** * Show notification * * @param {Object} payload */ var showNotification = function showNotification(payload) { console.log('worker-push-notification showNotification()', payload); var data = payload.data, _payload$data = payload.data, title = _payload$data.title, domain = _payload$data.domain, event = _payload$data.event, body = _payload$data.body; if (!event) { return null; } return self.clients.matchAll({ includeUncontrolled: true }).then(function (clientsList) { var hasActivePage = clientsList.length && clientsList.some(function (client) { return client.focused; }); console.log('worker-push-notification showNotification() is active page', hasActivePage); if (!hasActivePage) { // Customize notification here var notificationTitle = title; var notificationOptions = { icon: staticRoot + '/..' + (domain ? PUSH_API_ICONS.XHAMSTERLIVE : PUSH_API_ICONS.STRIPCHAT), data: data, body: body }; return self.registration.showNotification(notificationTitle, notificationOptions); } return null; }); }; /** * Initialize firebase app */ var initializeApp = function initializeApp() { if (client) { return; } /** * Initialize the Firebase app in the service worker by passing in the messagingSenderId. */ client = firebase.initializeApp({ messagingSenderId: senderId }); /** * Retrieve an instance of Firebase Messaging so that it can handle background messages. */ var messaging = firebase.messaging(); /** * Set background message handler */ messaging.setBackgroundMessageHandler(function (payload) { console.log('worker-push-notification setBackgroundMessageHandler', payload); return showNotification(payload); }); }; /** * Update config */ var updateConfig = function updateConfig() { if (!isFetching) { isFetching = true; configPromise = fetch(apiUrl).then(function (data) { return data.json(); }).then(function (data) { var config = data.config; console.log('worker-push-notification fetch config', data); staticRoot = config.staticRoot; senderId = config.fcm.senderId; isFetching = false; initializeApp(); }); } return configPromise; }; /** * Add event listener activate */ self.addEventListener('activate', function (event) { console.log('worker-push-notification activate()', event); if (!client) { event.waitUntil(updateConfig()); } }); /** * Add event listener push */ self.addEventListener('push', function (event) { var data = event.data.json(); console.log('worker-push-notification push()', event, data); var promise = new Promise(function (resolve) { if (!client) { return updateConfig().then(function () { return showNotification(data); }).then(function () { return resolve(); }); } return resolve(); }); event.waitUntil(promise); }); /** * Add event listener notification click * Call if click on notification */ self.addEventListener('notificationclick', function (event) { console.log('worker-push-notification notificationclick()', event); event.waitUntil(openClientPage(event)); }); updateConfig(); }()); ØA —Eoúô»¥ðÕðoW@J^AÅ. K^AÅ.ÿHTTP/1.1 200status:200server:nginxdate:Mon, 05 Mar 2018 14:24:33 GMTcontent-type:application/javascript; charset=utf-8last-modified:Wed, 28 Feb 2018 15:35:58 GMTvary:Accept-Encodingetag:W/"5a96cc5e-18d5"x-frame-options:denycontent-encoding:gzip¾0‚º0‚¢  êm“ùÛ¶–HoB<œžM0  *†H†÷  0^1 0 UUS10U  DigiCert Inc10U www.digicert.com10URapidSSL RSA CA 20180 180207000000Z 181208120000Z010U *.stripchat.com0‚"0  *†H†÷ ‚0‚ ‚½Üq{ü¥{бˆ¦Úœ¶  ²äžG“‰2D�ö…pLu‘w³¥Ä“x­à2äë ýËŸŽAŽˆÙðAbJ8¾¿~P©œ¨®Å¿Th”»ÛI.]’’­”í¯TG¼/0ã*Í�÷Á8Úh}³ø<…kTöû~7“Ó{nd³&[!¶î– ³ÙiPÑ"EKR‹U70503 1 /†-http://cdp.rapidssl.com/RapidSSLRSACA2018.crl0LU E0C07 `†H†ýl0*0(+https://www.digicert.com/CPS0g� 0u+i0g0&+0†http://status.rapidssl.com0=+0†1http://cacerts.rapidssl.com/RapidSSLRSACA2018.crt0 U00‚ +Öy�õ�òðv»Ùß¼Šqµ“”#—ª’{G8W• «Rè�–d6ŽÑ…api"†G0E!¤XNÙ”F¸�^�XQßÃl�0F�¯e_@þ›Ñ¨~±+Š Gqþ¼<@:ES&øä)” {]©”üX¾š°ûWûv‡u¿çY|øŒC™_½ónÿV�GV6ÿJµ`Á´êÿ^ ƒapi"¨G0E!ÀéÆnXÖSÀ½Nï.Èê®Êh „(oÀ»¥� YÖChÕŽæ�ŠÃT`þ±Ns˜JFÛ`ìÇ6]<>‡0  *†H†÷  ‚�êÊål¸®fþö�iX6z ¢”[wßbwfõ}>~£Œ…„dÄ�H€Û8Ø/ìBÍrëç³|©G‡gäö '—>sV³X¡ïí ‚š²7ŸLÀïÀÆÄ‡fŠÚ®Ùá¹ã°±Ü9ŽõÉŭ†±Íž¼ú>ßöÙXAó®Ùî÷E£.ÌxM n$˜Ò™ñä·šð•6\voȧc>8>°ÃÝB÷€½³›™¦ª˜ º½Œ¸×çaÌܦÖåÎP]® 8ò¹,àoY‡éµbÙ%À3®WI¸ÞÖ³ý$KšÀˆ³ÊVûHU–4@ï!u–®¾óF=)´þw”ǸÔ(Áµ0‚±0‚™ ¥¢FÍK\Œƒ×´»«SI0  *†H†÷  0a1 0 UUS10U  DigiCert Inc10U www.digicert.com1 0UDigiCert Global Root CA0 171106122333Z 271106122333Z0^1 0 UUS10U  DigiCert Inc10U www.digicert.com10URapidSSL RSA CA 20180‚"0  *†H†÷ ‚0‚ ‚å-¨Š(öyé{:3ˆ;qáe‹,)eýí-ÔF˜NgøÈæøš¼¾V‘ÏúwWä=| Ò.¸|ÀZ¶è¡ySE�!˜�§©‹´…£Qåƒ< ¼9ì¡NXýL¹6mì­nÑTë*[¥e%¶kØå_'‚ÊBîqQ4(é~pÄiÈœÎó* 0\ø'‚DðÞÍ[‰ÁA1KÇ.Í,pºfBœ{›TUØ f I‘×û`ßOrI"eà›vøðgÓ7ô©{xk¼â潃 ãÌŽím0ck$éOï×¥k�VþŸ½ªÈ鸤(9ôä†Bì;ÝuàzápñÓ!¶Lîßñø»pÎy$u£‚f0‚b0USÊYükÀ!/®äª¨‚VÚu0U#0€ÞP5VÑL»fð£âײ=ÑU0Uÿ†0U%0++0Uÿ0ÿ04+(0&0$+0†http://ocsp.digicert.com0BU;0907 5 3†1http://crl3.digicert.com/DigiCertGlobalRootCA.crl0cU \0Z07 `†H†ýl0*0(+https://www.digicert.com/CPS0  `†H†ýl0g� 0g� 0  *†H†÷  ‚~#ÇòÊ5nY’Q\ak<6æÒ|³)æBØ£•aÏò¯++%Zn£€R̪öß‘l'†…·¬€Šý^cKYý“uñ³†Hd­ G?$N(pŒëðþLƒ]dE�Ûš'¯TqzH¹™'›ßÐÆÅ:I‰†Îe\Ú(áÊ'R(‰À¦ª»áÙ¶«Éß)0„šƒÍÉR¬•Í­XúNÓ}½ü%ªÚJòªþº9##ÂéTÏGWƒ‡A«ì#_"¿¸)'èeC”CÎ�á:‘ÜBAb÷ÊÃr«HÄ ä}­©Žk–´À�lápXz7îlˆZQ±/ØS�wBjÿ…>^÷—M\Œœj³0‚¯0‚— ;àV�BF±¡ujÉY‘ÇJ0  *†H†÷ 0a1 0 UUS10U  DigiCert Inc10U www.digicert.com1 0UDigiCert Global Root CA0 061110000000Z 311110000000Z0a1 0 UUS10U  DigiCert Inc10U www.digicert.com1 0UDigiCert Global Root CA0‚"0  *†H†÷ ‚0‚ ‚â;árÞ¨¤Ó£WªP¢� w�É¢¥îΖ[ Ì“§N0·S÷CÄiW�â�"݇@� Î΃¿ßÍ;qFâÖfdzv'�{ž•}î·H£ÚÖ¯z 9eJ]¼ø«¾î(×tzx™Y…hn\#2K¿NÀèZmãp¿w¿üö…Ù¨DX2©uÕÑ¢¾Gâ'jôš3øI`‹Ô_´:„¿¡ªJL}>ÏO_lv^ K7‘žÜ"æmÎŽjËþͳdÇ[)ž2¿òîúÓ BÔ«·A2Ú Ôïø�Õ»�X?µèI(¢pÚ1Ý÷²òL N¨íJ=^µ£�ï'£c0a0Uÿ†0Uÿ0ÿ0UÞP5VÑL»fð£âײ=ÑU0U#0€ÞP5VÑL»fð£âײ=ÑU0  *†H†÷ ‚Ëœ7ªH úÝDœOR°ôß®õyy£$üK+„À-¹ÕÇþôÁX˸mœztç˜)«µãp ¡ÍLˆ™“Œ‘p⫾“©ÿcÕä`Ó£¿�[ ñÕŽãSôŽcú?§Û´fßbfÖÑnA�ò-µêwJŸ�Xâ+YÀ@#í-(‚E>yT’&˜à€H¨7ïðÖy`Þ¬èÍn¬D8/IÚáE>*¹6SÏ:P÷.èÄWIla!Õ­x<,:€k§ë¯騉Á¹8lâ‘lŠÿd¹w%W0À$£áÜéßG|µ´$0ì-½ ¿E¿P¹©ó똭ȈƘ4_� <ÆéÕ••mÞ0ÀP »Ùß¼Šqµ“”#—ª’{G8W• «Rè�–d6ŽÑ…p5c5Ã.G0E!¤XNÙ”F¸�^�XQßÃl�0F�¯e_@þ›Ñ¨~±+Š Gqþ¼<@:ES&øä)” {]©”üX¾š°ûWûGoogle 'Skydiver' log ‡u¿çY|øŒC™_½ónÿV�GV6ÿJµ`Á´êÿ^ ƒ@ 5c5Ã.G0E!ÀéÆnXÖSÀ½Nï.Èê®Êh „(oÀ»¥� YÖChÕŽæ�ŠÃT`þ±Ns˜JFÛ`ìÇ6]<>‡DigiCert Log Server 2p ¥jÏ4÷@ë$ ¨½u‰ 88.208.29.18»h2õÊ8÷H¡Öê÷&¸¤/µuÃÇd¨3x-á=¢Ù +ØA —Eoúô%=¿ºô